applyIf

inline fun <T> T.applyIf(check: Boolean, action: T.() -> Unit): T(source)
inline fun <T> T.applyIf(check: (T) -> Boolean, action: T.() -> Unit): T(source)

Applies the action to the receiver if the check succeeds. In either case returns the receiver itself.